home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / doc / memoration.doc < prev    next >
Text File  |  1994-02-13  |  4KB  |  87 lines

  1.                            Memoration V1.0
  2.                            William S. Hawes
  3.  
  4. Memoration is a tool to selectively limit the ability of a task or module
  5. to allocate memory, thereby simulating the effects of a low-memory
  6. condition without the bother of actually running out of memory.  It works
  7. by SetFunctioning the Exec AllocMem and/or AllocVec entries and then
  8. screening the requests. If a request from a particular task or range of
  9. addresses is received, memoration returns a zero instead of passing it
  10. through to AllocMem.
  11.  
  12. When a task or module is denied a memory request, memoration sends a
  13. message to the serial port identifying the client task ID, the address it
  14. was called from, and the size of the denied request.  If the software can't
  15. handle being denied its memory request, this message will typically be
  16. followed by a series of enforcer reports telling of how the software went
  17. ahead and wrote to location 0.
  18.  
  19.  
  20. Command-Line Parameters.
  21. Memoration accepts command-line parameters to specify the module or task
  22. name and the range of memory sizes to disallow.  The argument template is
  23.  
  24. MODULE,TASK/K,CLI/K/N,OFF/S,MIN/K/N,MAX/K/N,AFTER/K/N,EVERY/K/N,ALLADDR/S,
  25. ALLOCVEC/S,CHIP/S,FAST/S,BACKTRACE/K/N
  26.  
  27. and the specifications can be changed at any time by reissuing the command.
  28.  
  29.  
  30. MODULE is the name of a ROMTag or library.  The resident modules are
  31. searched first, followed by a search of the system library list.  When an
  32. entry is found, the range of addresses encompassing its code is determined
  33. using several methods.  For ROMTags the range extends from the ROMTag
  34. itself to the next higher module, or to RT_ENDSKIP if no higher module
  35. exists.  For libraries a certain amount of voodoo is required, as the
  36. location of the library ROMtag isn't stored in the (public) library
  37. structure. In this case memoration examines the LVOs to determine the
  38. lowest and highest addresses, and then searches for a ROMtag in the range
  39. (low-$2000,high+$2000).  If a ROMTag is found, memoration uses the smaller
  40. of the ROMTag addresss and the lowest LVO address as the low limit, and the
  41. larger of the RT_ENDSKIP address and the highest LVO address as the high
  42. limit.
  43.  
  44. TASK specifies the name of a task to trap.  The task must exist at the time
  45. memoration is run, and for best results should persist for the course of
  46. testing.  If you're using WShell (as you should be) you can define a name
  47. for a particular shell instance by using ``newwsh name sucker''.
  48.  
  49. CLI specifies a shell number as the task to trap.
  50.  
  51. MIN specifies the minimum memory requst to trap.  The default is 0.
  52.  
  53. MAX specifies the maximum allocation to trap.  The default is 2000000.
  54.  
  55. OFF turns off memory trapping.  The code patch is left intact, but won't
  56. trap any requests until enabled again.  AllocMem and AllocVec traps
  57. can be turned on and off separately.
  58.  
  59. ALLOCVEC sets the trap for the AllocVec() entry, instead of AllocMem().
  60. Both functions can be trapped independently.
  61.  
  62. AFTER specifies the number of allocations (within other specifications) to 
  63. pass before beginning the trap.
  64.  
  65. EVERY traps every Nth allocation meeting the specifications.
  66.  
  67. ALLADDR sets the address range to all memory.
  68.  
  69. CHIP limits the trap to CHIP memory specifications.
  70.  
  71. FAST limits the trap to FAST memory specifications.
  72.  
  73. BACKTRACE specifies the number of longwords of stack backtrace desired.
  74.  
  75.  
  76. Examples:
  77.   memoration dos.library  ; disable all DOS allocations
  78.   memoration task DF0 min 400 ; disable larger alocations by DF0:
  79.   memoration icon.library task Workbench every 3
  80.   memoration console.device min 40 backtrace 8
  81.  
  82.  
  83. Further Notes.
  84. Memoration uses a seglist-split for its code patch, and so shouldn't be made
  85. resident, at least not on the first execution.
  86.  
  87.